home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Check if a file exists?
- Date: 14 Apr 1996 09:22:01 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4kr8n9INN4he@keats.ugrad.cs.ubc.ca>
- References: <4kp7pg$upe@news-s01.ny.us.ibm.net> <829481378snz@genesis.demon.co.uk>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <829481378snz@genesis.demon.co.uk>,
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >In article <4kp7pg$upe@news-s01.ny.us.ibm.net>
- > bfilone@ibm.net "bfilone@ibm.net " writes:
- >
- >>Is it possible in C to check if a file exists other than checking for a
- >> succesful fopen?
- >
- >There is no other way in standard C. The only standard C library functions
- >that actually take a filename are fopen, freopen, rename and remove.
-
- But even so, Lawrence, how can you be sure that a successful fopen() means that
- the file really *exists*? Do computers exist?
-
- It seems that one has to approach fopen() with a certain metaphysical
- predisposition that a file really *can* exist.
-
- The proper discussion of file existence is to be found somewhere in alt.kooks
- and not comp.lang.c. As far as the standard is concerned, all that fopen()
- means is that certain things are logically possible that wouldn't be if fopen()
- failed. Assuming fopen() exists, of course. But that is off topic.
-
- :))
-